import styles from './styles.less';
import SearchForm from './components/SearchForm';
import DataTable from './components/DataTable';
import { useState } from 'react';
import DataForm from './components/DataForm';

const Right = props => {

  const { selectedId } = props.data;
  const [tablePayload, setTablePayload] = useState({ pageNum: 1, pageSize: 15, param: {} });
  const [dataForm, setDataForm] = useState(undefined);

  return (
    <div className={styles.myContainer}>
      <DataForm data={{ dataForm, setDataForm, tablePayload, setTablePayload, selectedId }} />
      <SearchForm data={{ tablePayload, setTablePayload }} />
      <DataTable data={{ setDataForm, tablePayload, setTablePayload, selectedId }} />
    </div>
  );
};

export default Right;
